package main

import (
	"fmt"
	"sync"
	"time"
)

var wg sync.WaitGroup

func byGo(i int) {
	for n := (i - 1) * 50000; n < i*50000; n++ {
		//for n := (i - 1) * 5; n < i*5; n++ {
		if n > 1 {
			var flag = true
			for i := 2; i < n; i++ {
				if n%i == 0 {
					flag = false
					break
				}
			}
			if flag {
				//fmt.Println("yes", n)
			}
		}
	}
	wg.Done()
}

func main() {
	start := time.Now().Unix()
	for i := 1; i < 5; i++ {
		wg.Add(1)
		go byGo(i)
	}
	wg.Wait()
	end := time.Now().Unix()
	fmt.Println(end - start)
}
